"""empty message

Revision ID: 48c867081066
Revises: 142e1feb0db3
Create Date: 2024-09-24 14:54:24.404073

"""

from collections.abc import Sequence
from typing import Union

import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "48c867081066"
down_revision: Union[str, None] = "142e1feb0db3"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("bot_model_configs", "suggested_questions")
    op.drop_column("bot_model_configs", "retriever_resource")
    op.drop_column("bot_model_configs", "suggested_questions_after_answer")
    op.drop_column("bot_model_configs", "opening_statement")
    op.drop_column("bot_model_configs", "text_to_speech")
    op.drop_column("bot_model_configs", "speech_to_text")
    op.drop_column("bot_model_configs", "completion_prompt_config")
    op.drop_column("bot_model_configs", "user_input_form")
    op.drop_column("bot_model_configs", "file_upload")
    op.drop_column("bot_model_configs", "more_like_this")
    op.drop_column("bot_model_configs", "external_data_tools")
    op.drop_column("bot_model_configs", "chat_prompt_config")
    op.drop_column("bot_model_configs", "dataset_configs")
    op.drop_column("bot_model_configs", "dataset_query_variable")
    op.add_column("conversations", sa.Column("datasets", sa.JSON(), nullable=True))
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("conversations", "datasets")
    op.add_column(
        "bot_model_configs",
        sa.Column("dataset_query_variable", sa.VARCHAR(length=255), nullable=True),
    )
    op.add_column("bot_model_configs", sa.Column("dataset_configs", sa.TEXT(), nullable=True))
    op.add_column("bot_model_configs", sa.Column("chat_prompt_config", sa.TEXT(), nullable=True))
    op.add_column("bot_model_configs", sa.Column("external_data_tools", sa.TEXT(), nullable=True))
    op.add_column("bot_model_configs", sa.Column("more_like_this", sa.TEXT(), nullable=True))
    op.add_column("bot_model_configs", sa.Column("file_upload", sa.TEXT(), nullable=True))
    op.add_column("bot_model_configs", sa.Column("user_input_form", sa.TEXT(), nullable=True))
    op.add_column(
        "bot_model_configs",
        sa.Column("completion_prompt_config", sa.TEXT(), nullable=True),
    )
    op.add_column("bot_model_configs", sa.Column("speech_to_text", sa.TEXT(), nullable=True))
    op.add_column("bot_model_configs", sa.Column("text_to_speech", sa.TEXT(), nullable=True))
    op.add_column("bot_model_configs", sa.Column("opening_statement", sa.TEXT(), nullable=True))
    op.add_column(
        "bot_model_configs",
        sa.Column("suggested_questions_after_answer", sa.TEXT(), nullable=True),
    )
    op.add_column("bot_model_configs", sa.Column("retriever_resource", sa.TEXT(), nullable=True))
    op.add_column("bot_model_configs", sa.Column("suggested_questions", sa.TEXT(), nullable=True))
    # ### end Alembic commands ###
